//
//  Connect.h
//  电销宝
//
//  Created by welldone on 13-4-10.
//  Copyright (c) 2013年 com.welldone. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NSString+MD5.h"
#import "FTWCache.h"



typedef enum : NSUInteger {
    ResultNetError = 0,//网络出错
    ResultSuccess = 1,//返回成功  需要判断是否有数据
    ResultFail = 2,//出错
} Result;





@interface ResulteMod : NSObject

@property (nonatomic,assign)Result resltState; //返回状态


@property (nonatomic,copy)NSString *resultData;//返回的json字符串
@property (nonatomic,copy)NSDictionary *resultDic;//返回的json对象  


@property (nonatomic,copy)NSString *resultCode,*resultTip;//服务端返回错误码和错误原因

@property (nonatomic,strong)id dataMod;

@property (nonatomic,strong)NSArray *otherDataMod;
@end





@interface Connect : NSObject
typedef  void(^FinishCallBack)(ResulteMod *resultMod);



+(ResulteMod*)doGetWithCaChe:(NSString *)urlString;

+(ResulteMod*)doGetWithOutCaChe:(NSString *)urlString;

+(void)doGetWithCaChe:(NSString *)urlString withCallBack:(FinishCallBack)block;

+(void)doGetWithOutCaChe:(NSString *)urlString withCallBack:(FinishCallBack)block;




+(ResulteMod*)doPostWithCache:(NSString *)urlString withData:(NSString*)badyString;

+(ResulteMod*)doPostWithOutCaChe:(NSString *)urlString withData:(NSString*)badyString;

+(void)doPostWithCache:(NSString *)urlString withData:(NSString*)badyString withCallBack:(FinishCallBack)block;

+(void)doPostWithOutCaChe:(NSString *)urlString withData:(NSString*)badyString withCallBack:(FinishCallBack)block;;




+(ResulteMod *)doPostOutCaCheWithUrl:(NSString *)urlString withParamDic:(NSDictionary *)dict;

+(ResulteMod *)doPostCaCheWithUrl:(NSString *)urlString withParamDic:(NSDictionary *)dict;



+(void)doPostWithCaCheWithUrl:(NSString *)urlString withFormdata:(NSDictionary *)formdata withCallBack:(FinishCallBack)callBack;

+(ResulteMod*)doPostWithOutCaCheWithUrl:(NSString *)urlString withFormdata:(NSDictionary *)formdata;





//暂不用
+(NSString *)doGetGbk:(NSString *)urlString;

+(NSString *)doGetGbkWithCaChe:(NSString *)urlString;
@end
  